<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">

	<ui:composition template="/template/template.xhtml">
	
		<ui:define name="title">Accueil</ui:define>
		<ui:define name="home_back_logo"><img
	src="/Covoiturage/static/img/car_50px.png" alt="logo" /></ui:define>

<ui:define name="body">
	<h:form>		
		
		<h:panelGroup rendered="#{homeCtrl.userNotConnected}">
			<div>
				<h:commandButton action="search" value="Chercher un trajet" styleClass="large" />
			</div>
			<hr/>
			<div>
				<h:commandButton action="#{beansUser.toLogin}" value="S'identifier" styleClass="large" />
				<h:commandButton action="#{beansUser.toCreatAccount}" value="Créer un compte" styleClass="large"/>					
			</div>
		</h:panelGroup>
		
		<h:panelGroup rendered="#{homeCtrl.userConnected}">
			
			<div class="readonly">☺ Bienvenue <h:outputText value=" #{beansUser.user.firstname} #{beansUser.user.lastname}" /></div>
			
			<div>				
				<h:commandButton action="create" value="Ajouter un trajet" styleClass="large" />
				<h:commandButton action="search" value="Chercher un trajet" styleClass="large" />
			</div>
			<hr />
			<div>
				<h:commandButton action="showProfile" value="Mon profil" styleClass="large" />
				<h:commandButton action="#{beansRoute.toIndex}" value="Consulter mes trajets" styleClass="large" />
				<h:commandButton action="#{beansUser.disconnect}" value="Déconnexion" styleClass="large" />
			</div>
	</h:panelGroup>
		
		
		
	</h:form>
</ui:define>
	</ui:composition>

</html>